package indi.defoliation.unknownrpg.api.rpgevent.player;

import org.bukkit.Location;
import org.bukkit.entity.Player;

import indi.defoliation.unknownrpg.api.attribute.Attribute;
import indi.defoliation.unknownrpg.api.rpgevent.Cancellable;
import indi.defoliation.unknownrpg.api.rpgevent.entity.EntityWalkEvent;

public class PlayerMoveCameraEvent extends EntityWalkEvent implements Cancellable{
	
	private boolean cancel = false;

	public PlayerMoveCameraEvent(Player what, Location from, Location to) {
		super(what, from, to);
	}
	
	@Override
	public Player getEntity() {
		return (Player) super.getEntity();
	}

	@Override
	public void setCancelled(Attribute operoter, boolean cance) {
		if(this.cancel==cance)
			return;
		this.cancel=cance;
		super.getTable().addAction(operoter, super.clone());
	}

	@Override
	public boolean isCancelled() {
		return cancel;
	}
}
